package com.surge;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SurgeMain {

	private static ApplicationContext ctx;

	public static void main(String[] args) {
		
		// 创建 Spring 的 IOC 容器
		ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		
		//ArithmeticCalculator arithmeticCalculator =  (ArithmeticCalculator) ctx.getBean("arithmeticCalculator");
		ArithmeticCalculator arithmeticCalculator =  (ArithmeticCalculator) ctx.getBean(ArithmeticCalculator.class);
		int result = arithmeticCalculator.add(3, 4);
		System.out.println(result);
		
		
		
		int result2 = arithmeticCalculator.div(3, 1);
		System.out.println(result2);
		
		
	}

}
